<script setup>
import { ElCard } from "element-plus";

const props = defineProps({
	patient: {
		type: Object,
		required: true
	},
	totalCount: {
		type: Number,
		default: 0
	}
});
</script>

<template>
	<div class="card-body-info">
		<div class="info-row">
			<div class="info-item">
				<span class="label"
					>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别:</span
				>
				<span class="value">{{ patient.sexName }}</span>
			</div>
			<div class="info-item">
				<span class="label">身份证号:</span>
				<span class="value">{{ patient.idCard }}</span>
			</div>
			<div class="info-item">
				<span class="label">检查数量:</span>
				<span class="value">{{ totalCount }}</span>
			</div>
		</div>
	</div>
</template>

<style scoped>
.card-body-info {
	padding: 15px 0;
}

.info-row {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

.info-item {
	display: flex;
	flex-direction: row;
	align-items: center;
	flex: 1;
	min-width: 200px;
}

.info-item .label {
	font-size: 12px;
	color: #606266;
	margin-right: 8px;
	white-space: nowrap;
	font-weight: 600;
}

.info-item .value {
	font-size: 14px;
	color: #606266;
	font-weight: 500;
	flex: 1;
	text-align: left;
}

/* 移动端适配 */
@media (max-width: 768px) {
	.info-row {
		flex-direction: column;
		gap: 10px;
	}

	.info-item {
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		min-width: 150px;
	}

	.info-item .label {
		font-size: 11px;
		color: #606266;
		margin-bottom: 0;
		font-weight: 600;
	}

	.info-item .value {
		font-size: 12px;
	}
}
</style>
